<?php


namespace App\Channels;


use App\Repository\WechatUserRepository;
use Illuminate\Notifications\Notification;
class WechatChannel
{
    public $wechatUserRepository;
    public function __construct(WechatUserRepository $wechatUserRepository)
    {
        $this->wechatUserRepository=$wechatUserRepository;
    }

    /**
     * 发送指定的通知.
     *
     * @param  mixed  $notifiable
     * @param  \Illuminate\Notifications\Notification  $notification
     * @return void
     */
    public function send($notifiable, Notification $notification)
    {
        $message = $notification->toWechat($notifiable);
        $this->wechatUserRepository->send($notifiable,$message);
    }
}
